package com.maschinenstuermer.example.ejb3.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;

@Entity
@NamedQuery(name=Company.FIND_BY_NAME_WITH_EMPLOYEES, query="SELECT c FROM Company c WHERE name = :name")
public class Company implements Serializable {
	public static final String FIND_BY_NAME_WITH_EMPLOYEES = "findByNameWithEmployees";

	private int id;
	private String name;

	public Company() {
	}

	public Company(String name) {
		super();
		this.name = name;
	}

	@Column(name="NAME", nullable=false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="ID", nullable=false)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
}
